import MyPromise from './promiseAPlus.js';
let promise1 = new Promise((resolve, reject) => setTimeout(resolve, 300, 'Promise 1 resolved'));
let promise2 = new Promise((resolve, reject) => setTimeout(resolve, 200, 'Promise 2 resolved'));
let promise3 = new Promise((resolve, reject) => setTimeout(reject, 150, 'Promise 3 rejected'));

MyPromise.race([promise1, promise2, promise3])
  .then((result) => {
    console.log(result);
  })
  .catch((reason) => {
    console.error(reason);
  });
